package com.hwadee.JPKC.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hwadee.JPKC.dao.conmmentMapper;
import com.hwadee.JPKC.entity.comment;
import com.hwadee.JPKC.service.ConmmentService;

@Service
public class ConmmentServiceImpl implements ConmmentService {

	@Resource
	private conmmentMapper conmmentmapper;

//以id查所有
	@Override
	public comment selectByPrimaryKey(Integer expertId) {
		// TODO Auto-generated method stub
		return conmmentmapper.selectByPrimaryKey(expertId);
	}

//查所有
	@Override
	public List<comment> getAll() {
		// TODO Auto-generated method stub
		return conmmentmapper.getAll();
	}

//以id删除
	@Override
	public int deleteByPrimaryKey(Integer expertId) {
		// TODO Auto-generated method stub
		return conmmentmapper.deleteByPrimaryKey(expertId);

	}
//用戶id刪除評論
	@Override
	public int delete(int userId) {
		// TODO Auto-generated method stub
		return conmmentmapper.deleteUID(userId);
	}

	@Override
	public List<comment> selectCourseId(Integer courseId) {
		// TODO Auto-generated method stub
		return conmmentmapper.selectCourseId(courseId);
	}

	@Override
	public int insertSelective(comment conmment) {
		// TODO Auto-generated method stub
		return conmmentmapper.insert(conmment);
	}

	@Override
	public int insert(comment comment) {
		// TODO Auto-generated method stub
		return conmmentmapper.insert(comment);
	}
	

	
}
